package org.example.demo6;

import java.util.ServiceLoader;

public class Demo {
    public static void main(String[] args) {
        ServiceLoader<Foo> load = ServiceLoader.load(Foo.class);//读取 resources/META-INF/services/org.example.demo6.Foo
        for (Foo foo : load) {
            foo.foo();
        }
    }
}
